<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {

    dd(Auth::check());
});


Route::group(['prefix' => 'auth', 'namespace' => 'Auth'], function() {
    // Authentication routes...
    Route::get('login', 'AuthController@getLogin');
    Route::post('login', 'AuthController@postLogin');
    Route::get('logout', 'AuthController@getLogout');

    // Registration routes...
    Route::get('register', 'AuthController@getRegister');
    Route::post('register', 'AuthController@postRegister');
});

Route::group(['prefix' => 'root', 'namespace' => 'Root', 'middleware' => 'auth'], function() {
    Route::patterns([
        'users' => '^[1-9]\d*$',
        'tags' => '^[1-9]\d*$',
        'domains' => '^[1-9]\d*$',
    ]);

    Route::get('/', 'IndexController@index');

    Route::resources([
        'users' => 'UserController',
        'tags' => 'TagController',
        'domains' => 'DomainController'
    ]);
});